package com.tanhua.server.controller;

import com.tanhua.commons.utils.UserHolder;
import com.tanhua.model.vo.HuanXinUserVo;
import com.tanhua.server.service.UsersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author maorf
 * @version 1.0
 */
@RestController
@RequestMapping("huanxin")
public class HuanXinController {
    @Autowired
    private UsersService userService;
    @GetMapping("user")
    public ResponseEntity user(){
        HuanXinUserVo userVo = userService.findHuanXinUser(UserHolder.getUserId());
        return ResponseEntity.ok(userVo);
    }
}
